import Vue from 'vue'
import Vuex from 'vuex'
import app from './modules/app'
import user from './modules/user'
import tagsView from './modules/tagsView'
import permission from './modules/permission'
import settings from './modules/settings'
import common from './modules/common'
import suggestion from './modules/suggestion'
import baseSettings from './modules/baseSettings'
import getters from './getters'
import notes from './modules/notes'
import workManagement from './modules/workManagement'
import createPersistedState from 'vuex-persistedstate';
Vue.use(Vuex)

const store = new Vuex.Store({
  modules: {
    app,
    user,
    tagsView,
    permission,
    settings,
    baseSettings,
    common,
    suggestion,
    notes,
    workManagement
  },
  getters,
  plugins: [createPersistedState({
    key: 'vuex',
    paths: ['user','baseSettings','notes'] // 这里便只会缓存user下的state值
  })]
})

export default store
